<?
	@session_start();
	$file = fopen("counter.dat","r");
	$strtim="";
	while (!feof($file))
	{
		$strtim.= trim(fgets($file));
	}
	$tm=explode(',', trim($strtim));
	unset($tm[count($tm)-1]);
	$string=$tm[count($tm)-1];
	$num=explode('|', $string);
	$counter=intval($num[0]);
	if(!$_SESSION['jingyun'])  
	{
		$_SESSION['jingyun'] = true;
		$counter++;
		$fp = fopen("counter.dat","a");
		fwrite($fp, $counter."|".date('Y-m-d h:i:s',time()).", \n");
		fclose($fp);
		$file ="useragent.txt";
		$file_handle = fopen($file, "a");
		fwrite($file_handle,$_SERVER['HTTP_USER_AGENT']."  \n\r");
		fclose($file_handle);
	}
?>
